<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta  charset="UTF-8">
<style>
	table {margin:0px; padding:0px;}
	table.tbfix {width:100%; table-layout:fixed; background:#bbb}
	table.tbcom {width:100%; background:#bbb}
	td {padding:3px; background:#fff}
	td.title {background:#eee}
	td.left {width:150px}
	input.button {width:100px}
	textarea#result {width:100%; height:300px; background:#ffffe0}
</style>
<script  type="text/javascript"  src="../static/js/jquery-1.4.4.js"></script>
<script  type="text/javascript"  src="../static/js/jquery.cookie.js"></script>
<script  type="text/javascript"  src="../static/api/app.util.js"></script>
<script  type="text/javascript"  src="../static/api/apiTest.js"></script>
</head>
<body>
	<h2>RuyiziService Debug Server - v1.0</h2>
	<hr>
<a  href="./home">Home</a>
| <a  href="./apilist">Api Test</a>
| <a  href="./apistat">Api Stat</a>
<hr>
<script type='text/javascript'>
$(document).ready(function(){var header={};$('.doTest').click(function(){apiTest(header)});});
</script>
<input type='hidden' id='action' value='../api/u/upimg'/>
<input type='hidden' id='method' value='post'/>
<table class='tbcom' cellpadding=1 cellspacing=1>
<tr><td class='title' colspan=2>Api Test >上传头像图片接口</td></tr>
<tr><td class='left'>title</td><td>上传头像图片接口</td></tr>
<tr><td class='left'>url</td><td>/api/u/upimg</td></tr>
<tr><td>Test Data</td><td><table>
  <tr><td>KEY : <input type='text' name='paramKey' value='key'/> VALUE : <input id="loginKey" type='text' name='paramVal' style='width:300px' value=''/> (STRING 登录密钥) </td></tr>
  <tr><td colspan="2">KEY:img</td></tr>
  <tr>
  	<td colspan="2">
  		<input id="img" type="file" name="img" imgTarget="#logoShow"
                		uploaderImage="../static/uploadify/scripts/uploadify.swf"
                		cancelImg="../static/uploadify/cancel.png" 
                		script="http://localhost/api/u/upimg" 
                		scriptData="{key:1}"
                		fileQueue="fileQueue" multi="false"
                		onAllComplete="uploadifyUserImgComplete" 
                		fileExt="*.jpg;*.jpeg;*.gif;*.png;"
                		fileDesc="*.jpg;*.jpeg;*.gif;*.png;"/>
 	<script type="text/javascript">
	 	var loginKey = $.cookie("loginKey");
		var img = $("#img");
		if(img && loginKey){
			img.attr("scriptData","{'key':"+loginKey+"}");
		}
		$(":file[uploaderImage]").each(function(){
			var $this = $(this);
			var options = {
				uploader: $this.attr("uploaderImage"),
				script: $this.attr("script"),
				cancelImg: $this.attr("cancelImg"),
				queueID: $this.attr("fileQueue") || "fileQueue",
				fileDesc: $this.attr("fileDesc") || "*.jpg;*.jpeg;*.gif;*.png;*.pdf",
				fileExt : $this.attr("fileExt") || "*.jpg;*.jpeg;*.gif;*.png;*.pdf",
				folder	: $this.attr("folder") || "/upload",
				auto: $this.attr("auto") || true,
				multi: $this.attr("multi") || true,
				buttonImg:top.Bird.homePath+'/images/mshop/uploader_image.jpg',
				fileDataName: $this.attr("fileDataName") || $this.attr("name"),
				onError:uploadifyError,
				removeCompleted:true,
				onComplete: $this.attr("onComplete") || migr.uploadifyImageComplete,
				onAllComplete: $this.attr("onAllComplete") || uploadifyAllComplete
			};
			if ($this.attr("onComplete")) {
				options.onComplete = Bird.jsonEval($this.attr("onComplete"));
			}
			if ($this.attr("onAllComplete")) {
				options.onAllComplete = Bird.jsonEval($this.attr("onAllComplete"));
			}
			if ($this.attr("scriptData")) {
				options.scriptData = Bird.jsonEval($this.attr("scriptData"));
			}
			$this.uploadify(options);
		});
 	</script>
  	</td>
  </tr>
  <tr><td colspan="2">
  	<img id="logoShow" src="../static/images/default.jpg" width="90" height="90"/>
  </td></tr>
  <tr><td colspan="2">
  	<div id="fileQueue" class="fileQueue"></div>
  </td></tr>
</table></td></tr>
<tr><td class='left'>method</td><td>post</td></tr>
<tr><td class='left'>Test Submit</td><td><input type='button' class='doTest' value='提交测试'/></td></tr>
<tr><td class='left'>Test Result</td><td><textarea id='result'></textarea></td></tr>
</table>
</body></html>